package com.mvc.login;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.mvc.action.Action;
import com.mvc.action.ActionView;
import com.mvc.form.ActionForm;

public class LoginAction implements Action {

	@Override
	public ActionView execute(HttpServletRequest request, HttpServletResponse response,ActionForm actionForm) {
		LoginForm form = (LoginForm)actionForm;
		System.out.println("LoginAction execute -> " + form);
		ActionView actionView = new ActionView("success");
		actionView.addObject("username", form.getUsername()); 
		return actionView;
	}

	public ActionView Login(HttpServletRequest request, HttpServletResponse response,ActionForm actionForm) {
		LoginForm form = (LoginForm)actionForm;
		System.out.println("LoginAction Login -> " + form);
		ActionView actionView = new ActionView("success");
		actionView.addObject("username", form.getUsername()); 
		return actionView;
	}
}
